﻿
namespace Juego_Lp.Characters
{
    public class Soldiers : Character
    {
        /*------------------------------------------|ATRIBUTES|-----------------------------------------*/
        private char type;
        private int angle;      //más adelante se empleará
        private int kills;
        private int latency;    //aún no relevante
        private int moneyDeath;
        private string description;
        private int scope;      //indica el alcance de Celdas de disparo que tiene.

        /*--------------------------------------|SETTERS & GETTERS|-------------------------------------*/
        public int getType()
        {
            return type;
        }

        public void setType(char type)
        {
            this.type = type;
        }

        public int getAngle()
        {
            return angle;
        }

        public void setAngle(int angle)
        {
            this.angle = angle;
        }

        public int getNumberDeleted()
        {
            return kills;
        }

        public void setNumberDeleted(int kills)
        {
            this.kills = kills;
        }

        public int getLatency()
        {
            return latency;
        }

        public void setLatency(int latency)
        {
            this.latency = latency;
        }

        public int getMoneyDeath()
        {
            return moneyDeath;
        }

        public void setMoneyDeath(int moneyDeath)
        {
            this.moneyDeath = moneyDeath;
        }

        public string getDescription()
        {
            return description;
        }
        public void setDescription(string description)
        {
            this.description = description;
        }

        /*-------------------------------------------|OTHERS|-------------------------------------------*/
        void move(char opcMov)
        {
            //Coordenadas Abajo y Derecha POSITIVO; Arriba e Izquierda NEGATIVO.
            int x, y;

            //Mueve Arriba:
            if ((opcMov == 'W') || (opcMov == 'w'))
            {
                y = this.getY() - 1;
                this.setY(y);
            }

            //Mueve Abajo:
            if ((opcMov == 'S') || (opcMov == 's'))
            {
                y = this.getY() + 1;
                this.setY(y);
            }

            //Mueve Derecha:
            if ((opcMov == 'D') || (opcMov == 'd'))
            {
                x = this.getX() + 1;
                this.setX(x);
            }

            //Mueve Izquierda:
            if ((opcMov == 'A') || (opcMov == 'a'))
            {
                x = this.getX() - 1;
                this.setX(x);
            }

        }

        /*------------------------------------------|BUILDERS|-------------------------------------------*/

        public Soldiers()
        {
            setLife(100);
            kills = 0;
            setX(0);
            setY(0);
        }


        public Soldiers(char type, int posX, int posY)
        {
            this.type = type;
            setX(posX);
            setY(posY);
            if (type == 1)
            {
                scope = 5;
                setLife(100);
                setName("Gunman");
                setAccuracy(80);    //porcentaje
            }
            if (type == 2)
            {
                scope = 3;
                setLife(200);
                setName("Fireshooter");
                setAccuracy(100);   //porcentaje
            }
            if (type == 3)
            {
                scope = 7;
                setLife(300);
                setName("Bazooker"); ;
                setAccuracy(70);    //porcentaje
            }
        }

        /*-----------------------------------------|DESTROYER|-------------------------------------------*/
        ~Soldiers()
        {
            setLife(0);
            System.Console.WriteLine("El soldado calló");
            if (type == 1)
                moneyDeath = 50;
            if (type == 2)
                moneyDeath = 100;
            if (type == 3)
                moneyDeath = 150;
        }
    }
}